package cn.wolfcode.qo;

import cn.wolfcode.enums.CustomerReportEnum;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;


@Getter
@Setter
public class CustomerReportQueryObject extends QueryObject{
//     传进来Business这些大写的, 然后得到Business(name,sql),再获取sql
//    刚开始先确认以门店分类
//    从前台返回的相当于赋值到这个变量,覆盖掉现在的这个,
//    即:String groubByName=CustomerReportEnum.Business.name();的下面
//      groubByName=刚赋值进来的
     private String groubByName=CustomerReportEnum.Business.name();

     private Long businessId;

     @DateTimeFormat(pattern = "yyyy-MM-dd")
     private Date startTime;

     @DateTimeFormat(pattern = "yyyy-MM-dd")
     private Date endTime;

     private Long ano;

    public String getGroubBy(){
         return CustomerReportEnum.valueOf(this.groubByName).getSql();
    }

}
